import React from 'react'
import PropTypes from 'prop-types'
import { Icon, Card } from 'antd'
import CountUp from 'react-countup'
import './numberCard.less';
export default class  NumberCard extends React.Component{

    constructor(props){
        super(props)
    }
    render(){
        debugger;
        const { icon , color, number, title }=this.props;
        return (
            <Card className="numberCard" bordered={false} bodyStyle={{ padding: 0 }}>
                <Icon className={color+" iconWarp"}  type={icon} />
                <div className="content">
                    <p className="title">{title || 'No Title'}</p>
                    <p className="number">
                        <CountUp
                            start={0}
                            end={number||100}
                            duration={2.75}
                            useEasing
                            useGrouping
                            separator=","

                        />
                    </p>
                </div>
            </Card>
        )
    }
}

NumberCard.propTypes = {
    icon: PropTypes.string,
    color: PropTypes.string,
    title: PropTypes.string,
    number: PropTypes.number,
    countUp: PropTypes.object,
}